/* $Header: p_config.h,v 2.2 01/10/02 10:30:33 przybyls Exp $ */

/***********************************************************************/
/* INCLUDE FILE NAME:                                                  */
/* ==================                                                  */
/*                                                                     */
/* Author:                                                             */
/*                                                                     */
/* COMMENT:                                                            */
/*                                                                     */
/*                                                                     */
/*                                                                     */
/*                                                                     */
/***********************************************************************/

#ifndef P_CONFIG_H
#define P_CONFIG_H

/*****************************/
/*   IFDEFS                  */
/*****************************/


/*****************************/
/*   SYMBOLIC CONSTANTS      */
/*****************************/


/*****************************/
/*   MACROS                  */
/*****************************/

#define ID_STRING_SIZE   20   /* including the '0 terminator */

/*****************************/
/*   TYPEDEFS                */
/*****************************/

typedef enum { UNCALIBRATED, LENGTH_ONLY, DIAM_ONLY, LENGTH_AND_DIAM } CALIB_MODE;

typedef struct
        {
             U_INT32  Calib_Length;
             U_INT32  Calib_Diam;

             DATETIME Date;

             U_INT32  Holdup_Time;
             U_INT32  Measured_Flow;

             CALIB_MODE Mode;

        } COLUMN_CALIB;


#define CALIB_GAIN_SCALING 16384


typedef struct INLET_CONFIG_STRUCT
       {
             BIT8                  Functional;

             INLET_TYPE            Type;

#ifdef SUPPORT_UNSUPPORTED_INLET_TYPES

             INLET_TYPE            True_Type;
#endif
 
             U_INT32               P_Sensor_Range;

             GAS_TYPE              Gas_Type;

             INT32                 Flow_Equib_Time;

             INT32                 Pres_Equib_Time;

             BIT8                  FS_Auto_Cal;

             PNEU_PORT_STATE       VI_Split_Port;

       } INLET_CONFIG, *pINLET_CONFIG;





typedef struct COLUMN_CONFIG_STRUCT
        {
               BIT8                Defined;

               U_INT16             Length;
               U_INT16             Diam;
               U_INT16             Film_Thickness;

               SOURCE_CONNECTION   Source;
               OUTLET_CONNECTION   Outlet;

               ON_OFF              Vacuum_Comp;

               ON_OFF              Outlet_Pressure_Correction;
               U_INT16             Outlet_Correction;          /* always 80 dcm2/iu */

               COLUMN_CALIB        Calib;

               char                ID_String[ ID_STRING_SIZE ];  /* for workstation convience, not used by iq */

        } COLUMN_CONFIG, *pCOLUMN_CONFIG;




typedef struct 
        {
             GAS_TYPE              Gas_Type;
    
             U_INT32               P_Sensor_Range;


        } DET_GAS_CONFIG, *pDET_GAS_CONFIG;




typedef struct DETECTOR_CONFIG_STRUCT
        {
             BIT8                  Functional;

             EEPROM_DET_TYPE       Type;

             DET_GAS_CONFIG        Gas_1;
             DET_GAS_CONFIG        Gas_2;
             DET_GAS_CONFIG        Gas_3;

        } DETECTOR_CONFIG, *pDETECTOR_CONFIG;





typedef struct AUX_CONFIG_STRUCT
       {
             BIT8            Functional;
      
             GAS_TYPE        Gas_Type;

             INT32           Pres_Equib_Time;

             U_INT32         P_Sensor_Range;


       } AUX_CONFIG, *pAUX_CONFIG;






typedef struct PNEU_CONFIG_STRUCT
        {
               INLET_CONFIG               Frnt_Inlet;
               INLET_CONFIG               Back_Inlet;

               COLUMN_CONFIG              Column_1;
               COLUMN_CONFIG              Column_2;

               DETECTOR_CONFIG            Frnt_Detector;
               DETECTOR_CONFIG            Back_Detector;

               BIT8                       Aux_Present;

               AUX_CONFIG                 Aux_3;
               AUX_CONFIG                 Aux_4;
               AUX_CONFIG                 Aux_5;

               PRES_UNITS                 Pressure_Display_Units;

               BIT8                       Dirt_Ball;  /* true if no epc */

               BIT8                       Shortcut_Enabled;  /* jumper in place on pcb2, allows more things in pneu_keys */


        } PNEU_CONFIG, *pPNEU_CONFIG;



typedef struct
        {
             PNEU_CONFIG       Pneu;

        } INST_CONFIG;





#pragma SECTION DATA=pfail

extern  INST_CONFIG      Inst_Config;

#pragma SECTION UNDO


/*****************************/
/*   FUNCTION PROTOTYPES     */
/*****************************/

#endif
